package com.xiaoyu.lanling.feature.vip.model

import `in`.srain.cube.request.JsonData
import android.text.TextUtils
import com.xiaoyu.lanling.media.image.ImageLoadParam
import java.io.Serializable

class VipInfo(jsonData: JsonData) : Serializable {
    val name = jsonData.optString("name")
    val type = jsonData.optString("type")
    val icon = jsonData.optString("icon")
    val isVip = !TextUtils.isEmpty(type)

    val imageLoadParam
        get() = ImageLoadParam.newBuilder().setEnableEmptyUrl(true).setUrl(icon).setSizeInDP(24).build()
}